<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>个人中心</title>
    <script type="text/javascript"  src="http://code.jquery.com/jquery-1.8.3.js"></script>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script type="text/javascript"  src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="index.css">
  <link rel="stylesheet" href="./static/dist/css/bootstrap.css">
  <script type="text/javascript" src="./static/store.legacy.min.js"></script>
  <script src="./static/util.js"></script>
</head>
<body>
  <header>
    <div class="headerSwipper">
      <div class="headerSwipper_div">
        <div class="headerSwipper_div_iconview">
          <img src="./static/images/logo.png" alt="">
        </div>
        <div class="headerSwipper_div_myicon">
          <!-- <img src="" alt=""> -->
          <span class="loginText">登录</span>
          <div class="headerSwipper_div_myicon_icon" style="display: none">
            <img src="./static/images/iconsmall.png" alt="">
          </div>
          <div class="headerSwipper_div_myicon_info">
            <ul>
              <li class="headerSwipper_div_myicon_info_li">消息</li>
              <li class="headerSwipper_div_myicon_info_li">退出</li>
            </ul>
          </div>
        </div>
        <ul class="headerSwipper_div_ul">
          <li class="headerSwipper_div_li mobileapp">手机APP</li>
          <li class="headerSwipper_div_li vipprop">开通VIP</li>
        </ul>
      </div>
    </div>
  </header>
  <section>
    <div class="sectionSwipper">
      <div class="section_div">
        <ul class="navside">
          <li class="navside_li navside_li_active" id="qu1">个人资料</li>
          <li class="navside_li" id="qu2">志愿表</li>
          <li class="navside_li" id="qu3">我的提问</li>
          <li class="navside_li" id="qu4">收藏的试题</li>
          <li class="navside_li" id="qu5">院校</li>
          <li class="navside_li" id="qu6">专业</li>
          <li class="navside_li" id="qu7">收藏的问题</li>
          <li class="navside_li" id="qu8">收藏的资讯</li>
        </ul>
        <!-- 上面导航条 -->
        <!-- <p class="section_div_p"><span class="section_div_p_span">首页></span>我的</p> -->
        <!-- 身份证卡片 -->
        <div class="section_idcard" style="display:none">
          <!-- <div class="idcardImg"><img src="./static/images/icon.png" alt=""></div>
          <p class="name">李木木<span class="name_span"><img src="./static/images/boy.png" alt=""></span></p>
          <p class="phoneInfo"><span class="phoneInfo_span">13588308249</span>文科<span></span></p>
          <p class="idcardNum"><span>身份证号:</span><span class="idcardNum_span">411325199503235051</span></p> -->
        </div>
        <!-- 最新以及未解决选项区域 -->
        <div class="iframeview">
          <!-- 问题回答区域 -->
          <div class="questionView">
            <ul class="questionView_ul questionView_ul_border">
              <!-- <li class="questionView_ul_li">
                <div class="quiconview"><img class="quiconview_img" src="./static/images/over.png" alt=""></div>
                <div class="textview">
                  <span class="textview_title">你好，请帮我把高考年份改成2021年，谢谢，孩子当时糊涂瞎填的，现在才发现，谢谢！</span>
                  <span class="textview_time">2018-09-06  16:26</span>
                  <span class="textview_answer">答：您好，请在周一至周五9：00-18:00拨打400-000-0000进行咨询。</span>
                </div>
                <div class="starcollectview">
                  <img class="starcollectview_img" style="display:block" src="./static/images/collect.png" alt="">
                  <img class="starcollectview_img" style="display:none" src="./static/images/collect_not.png" alt="">
                </div>
              </li> -->
            </ul>
            <!-- 志愿表 -->
            <table class="table table-bordered mytable mytable_zy">
              <tr>
                <td>名称</td>
                <td>模拟时间</td>
                <td>志愿批次</td>
                <td>志愿类型</td>
                <td>操作</td>
              </tr>
            </table>
            <!-- 收藏的试题 -->
            <table class="table table-bordered mytable mytable_test">
              <tr>
                <td>类型</td>
                <td>名称</td>
                <td>时间</td>
                <td>科类</td>
                <td>操作</td>
              </tr>
            </table>
            <!-- 专业 -->
            <table class="table table-bordered mytable mytable_sub">
              <tr>
                <td>专业名称</td>
                <td>所属学科</td>
                <td>操作</td>
              </tr>
            </table>
            <!-- 收藏的资讯 -->
            <table class="table table-bordered mytable mytable_news">
              <tr>
                <td>标题</td>
                <td>时间</td>
                <td>操作</td>
              </tr>
            </table>
            <!-- 分页 来自index.html -->
            <p class="pagingView">
              <span class="pagebtn firstpage">首页</span>
              <span class="pagebtn frontpage">前一页</span>
              <span class="pagesview">
                <!-- 动态添加页码 -->
              </span>
              <span class="pagebtn backpage">后一页</span>
              <span class="pagebtn lastpage">尾页</span>
            </p>
          </div>
        </div>
      </div>
    </div>

  </section>
  <footer>
    <div class="footerSwipper">
      <div class="footerSwipper_div">
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span"><a href="./index.html">首页</a></span>
          <li class="footerSwipper_div_ul_li"><a href="./schools.html?keyword=">院校大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./major.html">专业大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mentality.html">心理辅导</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./careerPlanning.html">职业规划</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./infoTest.html">高考资讯</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=1">自主招生</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=2">单独招生</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">学习提升</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=3">微课</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=4">模拟试题</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=5">往届试题</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">志愿填报</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=6">咨询</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mobileapp.html">下载APP</a></li>
        </ul>
        <!-- 扫一扫关注我们区域 -->
        <div class="QRcodeSwipper">
          <span class="QRcodeSwipper_span">扫一扫关注我们</span>
          <div class="QRcodeSwipper_imgview">
            <img src="./static/images/qr.png" alt="">
          </div>
        </div>
        <!-- 中间信息区域 -->
        <div class="middleInfo">
          <span class="middleInfo_span_city">中国·河南·郑州</span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special phone_icon"><img src="./static/images/phone.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_color">0371-68064945</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/message.png" alt=""></span><span class="middleInfo_span_GE_text">595879735@qq.com</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/store.png" alt=""></span><span class="middleInfo_span_GE_text">河南柒佰伴教育信息咨询有限公司
          </span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special address_icon"><img src="./static/images/address.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_special">郑州市郑东新区立体世界
            </span></span>
        </div>
        <p class="footerSwipper_div_p">河南世霖网络软件科技 2014-2018 豫ICP备14010456号-1</p>
      </div>
    </div>
  </footer>

  <script src="./static/util.js">
  </script>
  <script>
    $(document).ready(function(){
      var currentpage = 1
      var currentRender = 1
      var pagestotal = 1
      var typeindex = 0
      // 初始化请求url 请求参数
      var possibleUrl = ''
      var testQuestion = {
        uid: store.get('uid')
      }
      activequestion ('qu1')
      $('.headerSwipper_div_myicon_info').hide()
      ArrowNavigation($('.section_div'),["main","index"])
      console.log(getparse(location.href,0))
      // 点击导航切换事件
      $('.sectionSwipper').on('click','.navside_li',function(){
        clickchange($(this),'.navside_li','navside_li_active')
        var navtype = $(this).attr('id')
        activequestion(navtype)
      })
      // 点击未解决事件
      $('.questionItems').on('click','.questionItems_topnav_span',function(){
        clickchange($(this),'.questionItems_topnav_span','questionItems_topnav_span_active')
      })
      // 切换显示事件(问题)
      function activequestion (navtype) {
        var question = ''
        // 我的信息 section_idcard iframeview
        if(navtype == 'qu1') {
          $('.section_idcard').show()
          $('.iframeview').hide()
          possibleUrl = '/admin.php/api/index/getUserInfo'
          testQuestion = {}
          testQuestion.uid = store.get('uid')
          typeindex = 0
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
        // 志愿表
        if(navtype == 'qu2') {
          $('.section_idcard').hide()
          $('.iframeview').show()
          $('.questionView_ul').hide()
          $('.mytable').hide()
          $('.mytable_zy').show()
          possibleUrl = '/admin.php/api/goods/my_zyd'
          testQuestion = {}
          testQuestion.uid = store.get('uid')
          typeindex = 1
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
        // 我的提问
        if(navtype == 'qu3') {
          $('.section_idcard').hide()
          $('.iframeview').show()
          $('.mytable').hide()
          $('.questionView_ul').show()
          if(!$('.questionView_ul').hasClass('questionView_ul_border')) {
            $('.questionView_ul').addClass('questionView_ul_border')
          }
          possibleUrl = '/admin.php/api/homepage/my_issue_list'
          testQuestion = {}
          testQuestion.status = 1
          testQuestion.uid = store.get('uid')
          testQuestion.page = 1
          typeindex = 2 
          $('.iframeview').find('.questionItems_topnav').remove()
          $('.iframeview').prepend('<p class="questionItems_topnav"><span class="questionItems_topnav_span questionItems_topnav_span_active clearborderRight">最新</span><span class="questionItems_topnav_span">未解决</span></p>')
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
        // 收藏的试题
        if(navtype == 'qu4') {
          $('.section_idcard').hide()
          $('.iframeview').show()
          $('.mytable').hide()
          $('.questionView_ul').hide()
          $('.mytable_test').show()
          possibleUrl = '/admin.php/api/homepage/test_list'
          testQuestion = {}
          testQuestion.uid = store.get('uid')
          testQuestion.page = 1
          typeindex = 3
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
        // 收藏的院校
        if(navtype == 'qu5') {
          $('.section_idcard').hide()
          $('.iframeview').show()
          $('.mytable').hide()
          $('.questionView_ul').show()
          $('.questionView_ul').show()
          if($('.questionView_ul').hasClass('questionView_ul_border')) {
            $('.questionView_ul').removeClass('questionView_ul_border')
          }
          possibleUrl = '/admin.php/api/users/sch_list'
          testQuestion = {}
          testQuestion.uid = store.get('uid')
          testQuestion.page = 1
          typeindex = 4
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
        // 收藏的专业
        if(navtype == 'qu6') {
          $('.section_idcard').hide()
          $('.iframeview').show()
          $('.mytable').hide()
          $('.questionView_ul').hide()
          $('.mytable_sub').show()
          possibleUrl = '/admin.php/api/users/zy_list'
          testQuestion = {}
          testQuestion.uid = store.get('uid')
          testQuestion.page = 1
          typeindex = 5
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
        // 收藏的问题
        if(navtype == 'qu7') {
          $('.section_idcard').hide()
          $('.iframeview').show()
          $('.mytable').hide()
          $('.questionView_ul').show()
          if(!$('.questionView_ul').hasClass('questionView_ul_border')) {
            $('.questionView_ul').addClass('questionView_ul_border')
          }
          possibleUrl = '/admin.php/api/homepage/issue_sclst'
          testQuestion = {}
          testQuestion.status = 1
          testQuestion.uid = store.get('uid')
          testQuestion.page = 1
          typeindex = 2
          $('.iframeview').find('.questionItems_topnav').remove()
          $('.iframeview').prepend('<p class="questionItems_topnav"><span class="questionItems_topnav_span questionItems_topnav_span_active clearborderRight">最新</span><span class="questionItems_topnav_span">未解决</span></p>')
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
        // 收藏的资讯
        if(navtype == 'qu8') {
          $('.section_idcard').hide()
          $('.iframeview').show()
          $('.mytable').hide()
          $('.questionView_ul').hide()
          $('.mytable_news').show()
          possibleUrl = '/admin.php/api/homepage/collList'
          testQuestion = {}
          testQuestion.uid = store.get('uid')
          testQuestion.page = 1
          typeindex = 6
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
      }
      var dataRender
      // 加载问题方法
      function ajaxRender (url, test, callback, type) {
        console.log(test)
        $.ajax({
          url: urlhost + url,
          method: 'POST',
          data: test,
          success: function (res) {
            dataRender = res.data
            setTimeout(function () {
              if(res.last_page) {
                $('.pagingView').show()
                testQuestion.page = 1
                changeInitPage(res.last_page, 1)
                callback(dataRender, type)
              }else if(res.list_page) {
                $('.pagingView').show()
                testQuestion.page = 1
                changeInitPage(res.list_page, 1)
                callback(dataRender, type)
              }else {
                $('.pagingView').hide()
                callback(dataRender, type)
              }

            },0)
          }
        })
      }
      // 渲染方法
      var subject = 0
      var namename = ''
      function render (data, type) {
        // 个人信息加载
        if(type == 0) {
          subject = data.subject
          namename = data.name
          var sexx
          if(data.sex == "男") {
            sexx = './static/images/boy.png'
          }else {
            sexx = './static/images/girl.png'
          }
          var subjectlist = ["文科","理科"]
          $('.section_idcard').html('')
          var html = '<div class="idcardImg" id="info'+ data.id +'"><img src="'+ data.icon +'" alt="" class="icon_img_change"><input type="file" accept="image/*" name="file" /></div>'
           + '<p class="name">'+ data.name +'<span class="name_span"><img src='+ sexx +' alt=""></span></p>'
           + '<p class="phoneInfo"><span class="phoneInfo_span">'+ data.phone +'</span>'+ subjectlist[data.subject] +'<span>&nbsp;&nbsp;&nbsp;'+ data.province +'</span><span>&nbsp;&nbsp;&nbsp;'+ data.school_name +'</span></p>'
           + '<p class="idcardNum"><span>身份证号:</span><span class="idcardNum_span">'+ data.number_id +'</span></p>'
          $('.section_idcard').html(html)
        }
        // 志愿表加载
        var ed_list = ['','本科一批','本科二批','高职专科批']
        if(type == 1) {
          // console.log(data)
          $('.iframeview').find('.questionItems_topnav').remove()
          $('.mytable_zy').find('th').parent().remove()
          for(var i=data.length-1; i >= 0; i--) {
            $('.mytable_zy').append(
              '<tr id="zy' + data[i].id + '" sub_type="zy'+ data[i].pc_status +'">'
              + '<th>' + data[i].name + '</th>'
              + '<th>' + data[i].add_time + '</th>'
              + '<th>' + ed_list[data[i].pc_status] + '</th>'
              + '<th>' + data[i].gfzy + '</th>'
              + '<th>'
                +  '<span class="change">修改</span>'
                + '<span class="delete">删除</span>'
              + '</th>'
            + '</tr>'
            )
          }
        }
        // 我的提问 <p class="questionItems_topnav"><span class="questionItems_topnav_span questionItems_topnav_span_active clearborderRight">最新</span><span class="questionItems_topnav_span">未解决</span></p>
        if(type == 2) {
          // $('.iframeview').find('.questionItems_topnav').remove()
          $('.questionView_ul').html('')
          
          var srclist = ['./static/images/noyover.png', './static/images/over.png']
          var collect_img = ['./static/images/collect_not.png','./static/images/collect.png']
          var applyhtml = ''
          for(var i = 0; i < data.length; i++) {
            applyhtml += '<li class="questionView_ul_li" id="consultView' + data[i].id + '">'
           + '<div class="quiconview"><img class="quiconview_img" src="' + srclist[data[i].status] + '" alt=""></div>'
           + '<div class="textview">'
             + '<span class="textview_title">' + data[i].desc + '</span>'
             + '<span class="textview_time">' + data[i].add_time + '</span>'
             + '<span class="textview_answer"></span>'
           + '</div>'
           + '<div class="starcollectview">'
              + '<img class="starcollectview_img" img-star="'+ data[i].status +'" src="'+ collect_img[data[i].status] +'" alt="">'
            + '</div>'
         + '</li>'
          }
          $('.questionView_ul').html(applyhtml)
          for(var i = 0; i < data.length; i++) {
            let id = data[i].id
            $.post('http://jy.sanzhima.cn/admin.php/api/homepage/issue_detail',{
              uid: store.get('uid'),
              detail_id: data[i].id
            },function (answer) {
              console.log(id)
              // $('#consultView'+data[i].id)
              $('#consultView'+id).find('.textview_answer').text(answer.data.reply)
              // console.log(answer.data.reply)
              // applyhtml +=  '<span class="textview_answer">'+ answer.data.reply +'</span>'
            })
          }
        }
        // 收藏的试题
        if(type == 3) {
          $('.iframeview').find('.questionItems_topnav').remove()
          $('.mytable_test').find('th').parent().remove()
          for(var i=0; i < data.length; i++) {
            $('.mytable_test').append(
              '<tr id="test'+ data[i].id +'" type-id="'+ data[i].type +'">'
               + '<th>'
                 + '<img class="type_img" src="./static/images/yellowtest.png" alt="">'
               + '</th>'
               + '<th>河南省郑州市高二语文期中试题</th>'
               + '<th>2018-12-12</th>'
               + '<th>语文</th>'
               + '<th>'
                 + '<span class="change upfiles">下载</span>'
                 + '<span class="delete">删除</span>'
               + '</th>'
             + '</tr>'
            )
          }
        }
        // 收藏的院校
        if(type == 4) {
          $('.iframeview').find('.questionItems_topnav').remove()
          $('.questionView_ul').html('')
          var applyhtml = ''
          for(var i = 0; i < data.length; i++) {
            var spanhtml = ''
            spanhtml += '<span class="universitytext_lable_span">' + data[i].rank + '</span>'
            for(list in data[i]) {
              if(list.slice(0, 5) == 'label') {
                if(data[i][list]) {
                  spanhtml += '<span class="universitytext_lable_span">' + data[i][list] + '</span>'
                }
              }
            }
            var nowhtml = '<li class="universityView" id="school' + data[i].id + '">'
             + '<span class="universityImgview"><img class="universityImgview_img" src="' + data[i].sch_pic + '" alt=""></span>'
             + '<div class="universitytext">'
               + '<span class="universitytext_title">' + data[i].sch_name + '</span>'
               + '<p class="universitytext_lable">' + spanhtml + '</p>'
             + '</div>'
             + '<div class="addWish_shool">'
               + '<span class="addWishImgview_school"><img src="./static/images/GoItem.png" alt=""></span>'
             + '</div>'
           + '</li>'
            applyhtml += nowhtml
          }
          $('.questionView_ul').html(applyhtml)
        }
        // 收藏的专业
        if(type == 5) {
          $('.iframeview').find('.questionItems_topnav').remove()
          $('.mytable_sub').find('th').parent().remove()
          for(var i=0; i < data.length; i++) {
            $('.mytable_sub').append(
              '<tr id="sub'+ data[i].zy_id +'">'
               + '<th>'+ data[i].title +'</th>'
               + '<th>'+ data[i].title +'</th>'
               + '<th>'
                 + '<span class="delete">删除</span>'
               + '</th>'
            +  '</tr>'
            )
          }
        }
        // 收藏的资讯
        if(type == 6) {
          $('.iframeview').find('.questionItems_topnav').remove()
          $('.mytable_news').find('th').parent().remove()
          for(var i=0; i < data.length; i++) {
            $('.mytable_news').append(
              '<tr id="news'+ data[i].id +'">'
               + '<th>河南：关于做好2019年普通高校招生报名工作的通知</th>'
               + '<th>2018-12-12</th>'
               + '<th>'
                 + '<span class="delete">删除</span>'
               + '</th>'
             + '</tr>'
            )
          }
        }

      }
      // 点击最新和未解决切换
      $('.sectionSwipper').on('click', '.questionItems_topnav_span', function () {
        var index = $(this).index()
        testQuestion.status = Number(index) + 1
        ajaxRender(possibleUrl, testQuestion, render, typeindex)
        clickchange($(this), '.questionItems_topnav_span', 'questionItems_topnav_span_active')
      })
      // 鼠标移动到头像事件
      $('.headerSwipper_div_myicon').mouseenter(
        function () {
          $('.headerSwipper_div_myicon_info').show()
        }
      )
      $('.headerSwipper_div_myicon').mouseleave(
        function () {
          $('.headerSwipper_div_myicon_info').hide()
        }
      )
      // 定义ajax事件
      // 获取ajax传来的用户信息数据 方法
      function myInfo (data) {
        
      }
      // 模拟数据
      function init () {
        $('.navside_li').eq(0).click()
      }
      init()
      // 志愿表点击修改事件
      $('.table').on('click', '.change', function () {
        var this_id = $(this).parents('tr').attr('id').slice(2)
        var this_type = $(this).parents('tr').attr('id').slice(0, 2)
        var this_subtype = $(this).parents('tr').attr('sub_type').slice(2)
        if(this_type == 'zy') {
          // location.href = './simulation_change.html?id=' + this_id
          window.open('./simulation_change.html?id=' + this_id + '&ed=' + this_subtype)
        }
      })
    // 监听消息点击事件
    $('.headerSwipper_div_myicon').on('click', '.messagebtn', function() {
      window.location.href = './message.html'
    })
    // 监听开通VIP点击事件
    $('.headerSwipper').on('click', '.memberbtn', function() {
      window.location.href = './member.html'
    })
      // 页码专属ajax
      function pageAjax(possibleUrl, testQuestion) {
        loadingShow()
        $.ajax({
          url: urlhost + possibleUrl,
          type: 'POST',
          data: testQuestion,
          header: {},
          success: function (res) {
            if (res.code == 0) {
              loadingHide()
              dataNow = res
              var domlist = [$('.topThree'), $('.questionView_ul_more')]
              rendering(domlist[currentRender], currentRender, dataNow.data)
            } else {
              // 移除加载中样式
              loadingHide()
              return(res.data)
            }
          },
          fail: function () {
            alert('网络有问题')
          }
        })
      }
      // 删除事件
      // 试题 /admin.php/api/homepage/test_sc
      // 问题 /admin.php/api/homepage/issue_sc
      // 专业 /admin.php/api/users/zy_sc
      $('.section_div').on('click', '.delete', function () {
        var index_type = $('.navside_li_active').index()
        var index_type_list = ['','/admin.php/api/goods/del_tbzy','','/admin.php/api/homepage/test_sc','','/admin.php/api/users/zy_sc','/admin.php/api/homepage/issue_sc','/admin.php/api/homepage/collect']
        var id = $(this).parents('tr').attr('id')
        var type_id = $(this).parents('tr').attr('type-id')
        var index_list_slice = [0,2,0,4,6,3,0,4,4]
        id = id.slice(index_list_slice[index_type])
        var that = this
        // console.log(index_type)
        $.ajax({
          url: urlhost + index_type_list[index_type],
          type: 'POST',
          data: {
            uid: store.get('uid'),
            flag: 2,
            zy_id: id,
            sch_id: id,
            issue_id: id,
            art_id: id,
            zid: id,
            type: type_id,
            test_id: id
          },
          success: function (res) {
            if(res.code == '0') {
              // console.log(res)
              $(that).parents('tr').remove()
              widowAle(res.msg)
            }else {
              // 弹窗
              widowAle(res.msg)
            }
          }
        })
      })
      // 下载事件
      $('.questionView').on('click','.upfiles', function () {
        var testid = $(this).parents('tr').attr('id').slice(4)
        var type = $(this).parents('tr').attr('type-id')
        window.open('./testItem.html?id='+ testid +'&type=' + type)
      })
      // 全局页码初始化改变方法
      function changeInitPage (a, b) {
        currentpage = b
        currentRender = b
        pagestotal = a
        pagefuc(pagestotal, currentRender)
      }
      // 页码方法
      function pagefuc (pagestotal, currentpage){
        // 页面初始化方法
        function init(pagestotal, currentpage) {
          if(pagestotal <= 5) {
            var html = ''
            $('.pagesview').html('')
            for(var i=1; i <= pagestotal; i++) {
              if(i == currentpage) {
                html += '<span class="pageitem pageactive" id="' + i + '">' + i + '</span>'
              }else {
                html += '<span class="pageitem" id="' + i + '">' + i + '</span>'
              }
            }
            $('.pagesview').html(html)
          }else {
            var html = ''
            $('.pagesview').html('')
            var length = (Math.floor(currentpage/5)+1)*5 >= pagestotal?pagestotal:Math.floor(currentpage/5)*5+5
            for(var i=(Math.floor((currentpage-1)/5)+1)*5-4; i <= length; i++) {
              if(i == currentpage) {
                html += '<span class="pageitem pageactive" id="' + i + '">' + i + '</span>'
              }else {
                html += '<span class="pageitem" id="' + i + '">' + i + '</span>'
              }
            }
            $('.pagesview').html(html)
          }
        }
        init(pagestotal, currentpage)
        }
      // changeInitPage(pagestotal, currentpage)
      // 点击页码事件 页码变色 进行获取数据
      $('.pagingView').on('click', '.pageitem', function() {
        if($(this).hasClass('pageactive')) {
          return
        }
        $(this).parent().find('.pageitem').removeClass('pageactive')
        $(this).addClass('pageactive')
        currentpage = Number($(this).text())
        testQuestion.page = currentpage
        ajaxRender(possibleUrl, testQuestion, render, typeindex)
      })
      // 前一页事件
      $('.frontpage').click(
       function() {
          if(currentpage === 1) {
            return
          }
          if($('.pageactive').index() === 0) {
            $('#'+(currentpage+4)).remove()
            currentpage--
            $(this).parent().find('.pageitem').removeClass('pageactive')
            $('.pagesview').prepend('<span class="pageitem pageactive" id="' + currentpage + '">' + currentpage + '</span>')
            testQuestion.page = currentpage
            ajaxRender(possibleUrl, testQuestion, render, typeindex)
            return
          }
          currentpage--
          $(this).parent().find('.pageitem').removeClass('pageactive')
          $('#'+currentpage).addClass('pageactive')
          testQuestion.page = currentpage
          var dataNow =  ''
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
      )
      // 后一页事件
      $('.backpage').click(
         function() {
          // console.log(currentpage)
          if(currentpage === pagestotal) {
            return
          }
          if($('.pageactive').index() === 4) {
            $('#'+(currentpage-4)).remove()
            currentpage++
            $(this).parent().find('.pageitem').removeClass('pageactive')
            $('.pagesview').append('<span class="pageitem pageactive" id="' + currentpage + '">' + currentpage + '</span>')
            testQuestion.page = currentpage
            ajaxRender(possibleUrl, testQuestion, render, typeindex)
            return
          }
          currentpage++
          $(this).parent().find('.pageitem').removeClass('pageactive')
          $('#'+currentpage).addClass('pageactive')
          testQuestion.page = currentpage
          var dataNow =  ''
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
        }
      )
      // 首页事件
      $('.firstpage').click(
         function() {
          currentpage = 1
          testQuestion.page = currentpage
          var dataNow =  ''
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
          changeInitPage(pagestotal, currentpage)
        }
      )
      // 末尾页点击事件
      $('.lastpage').click(
         function() {
          currentpage = pagestotal
          testQuestion.page = currentpage
          ajaxRender(possibleUrl, testQuestion, render, typeindex)
          changeInitPage(pagestotal, currentpage)
        }
      )
      // 点击学校跳转
      $('.questionView').on('click', '.addWishImgview_school', function () {
        var school_id = $(this).parents('li').attr('id').slice(6)
        location.href = './shoolitemInfo.html?id=' + school_id
      })
      // 监听问题收藏事件
      $('.questionView').on('click', '.starcollectview', function () {
        var img_star = $(this).find('img').attr('img-star')
        var img_id = $(this).parents('li').attr('id').slice(11)
        if(img_star == '1') {
          $(this).find('img').attr('src', './static/images/collect_not.png')
          $(this).find('img').attr('img-star', '0')
          $.ajax({
            url: urlhost + '/admin.php/api/homepage/issue_sc',
            method: 'POST',
            data: {
              uid: store.get('uid'),
              flag: 2,
              issue_id: img_id
            },
            success: function (res) {
              widowAle(res.msg)
            }
          })
        }else {
          $(this).find('img').attr('src', './static/images/collect.png')
          $(this).find('img').attr('img-star', '1')
          $.ajax({
            url: urlhost + '/admin.php/api/homepage/issue_sc',
            method: 'POST',
            data: {
              uid: store.get('uid'),
              flag: 1,
              issue_id: img_id
            },
            success: function (res) {
              widowAle(res.msg)
            }
          })
        }
      })
      // 头像更换方法
      $('.section_idcard').on('change','input[type="file"]',function (e) {
        // console.log(e.target.files[0])
        var file_img = e.target.files[0]
        var src = window.URL.createObjectURL(file_img)
        var formdata = new FormData()
        formdata.append('file',file_img)
        formdata.append('uid',store.get('uid'))
        formdata.append('subject',subject)
        formdata.append('name',namename)
        $.ajax({
          url: urlhost + '/admin.php/api/index/setUser',
          method: 'POST',
          data: formdata,
          processData: false,
          contentType: false,
          success: function (res) {
            // console.log(res)
            $('.section_idcard').find('.icon_img_change').attr('src',src)
            $('.headerSwipper_div_myicon').find('img').attr('src',src)
            
          }
        })
      })
    })
  </script>
</body>
</html>